
#include <android/log.h>

#include "jni.h"
#include "jni_help.h"

namespace codec {
int register_codec(JNIEnv *env);
JavaVM *getJvm();
void setJvm(JavaVM *);
JNIEnv *jniEnv();
};  // namespace codec

using namespace codec;
extern "C" jint JNI_OnLoad(JavaVM *vm, void * /* reserved */) {
  JNIEnv *env = NULL;
  setJvm(vm);
  jint result = -1;
  if (vm->GetEnv((void **)&env, JNI_VERSION_1_6) != JNI_OK) {
    return result;
  }
  register_codec(env);
  return JNI_VERSION_1_6;
}
